<template>
	<view class="">
		<navView navTitle="知识产权" titleColor="#fff" :isBack="true"></navView>
		<view class="container">
			<!-- 顶部信息 -->
			<view class="top-info">
				<view class="top-info-item">
					<view class="top-info-number">{{ list.stats.invention }}</view>
					<view class="top-info-label">发明</view>
				</view>
				<view class="top-info-item">
					<view class="top-info-number">{{ list.stats.utility_model }}</view>
					<view class="top-info-label">实用新型</view>
				</view>
			</view>
			<!-- 专利信息列表 -->
			<view class="patent-item" v-for="(item, index) in list.patents" :key="index">
				<!-- 专利信息标题 -->
				<view class="patent-title">
					<text class="patent-name">{{ item.property_name }}</text>
					<button v-if="item.is_overdue == 1" class="status-button2">{{ item.late_status_text }}</button>
					<button v-else class="status-button">{{ item.late_status_text }}</button>
				</view>
				<!-- 专利信息内容 -->
				<view class="patent-content">
					<text>专利类型：{{ item.property_type }}</text>
					<text>专利号：{{ item.property_number }}</text>
					<text>申请日：{{ item.application_date }}</text>
					<text>公告日：{{ item.publication_date }}</text>
					<text>年费：{{ item.annual_fee }}</text>
					<text>年费缴纳日期：{{ item.annual_fee_payment_date }}</text>
					<text v-if="item.is_overdue == 1">滞纳金金额：{{ item.late_fee || 0 }}</text>
					<text v-if="item.is_overdue == 1">缴费金额：{{ item.payment_count || 0 }}</text>
					<text>下次缴费价格：{{ item.next_fee_payment_date || "不用缴费"}}</text>
				</view>
			</view>
		</view>
		<button class="btn" @tap="$navTo('/pages/knowledge/cart')">去缴费</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 如果需要动态数据，可以在这里定义
				list:[]
			};
		},
		onLoad() {
			this.getDetail()
		},
		methods: {
			getDetail() {
				this.$request('/addons/qingdong/contract/getUserPropertiesContactList', 'GET').then(res => {
					console.log(res)
					this.list = res.data
				})
			}
		}
	};
</script>

<style scoped>
	.container {
		padding: 20px;
	}

	/* 顶部信息样式 */
	.top-info {
		display: flex;
		justify-content: space-evenly;
		margin-bottom: 20px;
		background: #fff;
		border-radius: 16rpx;
		padding: 30rpx 0;
	}

	.top-info-item {
		text-align: center;
	}

	.top-info-number {
		font-size: 24px;
		font-weight: bold;
	}

	.top-info-label {
		font-size: 12px;
		color: #666;
	}

	/* 专利信息样式 */
	.patent-item {
		margin: 20px 0;
		background: #fff;
		box-shadow: 0rpx 2rpx 12rpx 2rpx rgba(97, 97, 97, 0.25);
		border-radius: 16rpx;
	}

	.patent-title {
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 1px solid #e5e5e5;
		padding: 20rpx;
		box-sizing: border-box;
	}

	.patent-name {
		font-size: 30rpx;
		font-weight: bold;
	}

	.status-button {
		background-color: #FFECD2;
		padding: 8rpx 28rpx;
		border-radius: 24rpx;
		font-weight: 400;
		font-size: 24rpx;
		color: #FF8800;
		line-height: 32rpx;
		margin: 0;
	}

	.status-button2 {
		background-color: #FFE1E1;
		padding: 8rpx 28rpx;
		border-radius: 24rpx;
		font-weight: 400;
		font-size: 24rpx;
		color: #E12828;
		line-height: 32rpx;
		margin: 0;
	}

	/* 专利内容样式 */
	.patent-content {
		margin-top: 10rpx;
		font-size: 24rpx;
		padding: 20rpx;
		box-sizing: border-box;
	}

	.patent-content text {
		font-weight: 400;
		font-size: 24rpx;
		color: #7D7D7D;
		display: block;
		margin: 10rpx 0;
	}

	.btn {
		width: 649rpx;
		height: 84rpx;
		background: #008EFF;
		border-radius: 84rpx 84rpx 84rpx 84rpx;
		position: fixed;
		bottom: 50rpx;
		left: 50%;
		transform: translate(-50%);
		font-weight: 400;
		font-size: 30rpx;
		color: #FFFFFF;
		line-height: 84rpx;
	}
</style>